
import feibao
import helpers
import eface
import hello
import django

page_dc = {
    "kv"	:helpers.director.admin_kv.KvTablePage,
    "kv.edit"	:helpers.director.admin_kv.KvFormPage,
    "del_rows"	:helpers.director.fields.delpage.DelPage,
    "log"	:helpers.director.log.logpage.LogPage,
    "user"	:helpers.director.admin.UserTablePage,
    "user.edit"	:helpers.director.admin.UserFormPage,
    "group"	:helpers.director.admin.GroupTablePage,
    "group.edit"	:helpers.director.admin.GroupFormPage,
    "permit.edit"	:helpers.director.admin.PermitFormPage,
    "group_human"	:helpers.director.admin.GroupGroup,
    "group_human.edit"	:helpers.director.access.assem_group.AssemGroupPage,
    "jb_user"	:helpers.case.jb_admin.admin_user.UserPage,
    "jb_group"	:helpers.case.jb_admin.admin_user.GroupPage,
    "enginhome"	:helpers.case.jb_admin.pages.engin_home.EngineHome,
    "wxuserinfo"	:eface.wechat.admin_wxuser.wxuser,
    "community"	:feibao.admin_community.CommunityPage,
    "region"	:feibao.admin_region.RegionPage,
    "order"	:feibao.admin_order.OrderPage,
    "garbage"	:feibao.admin_garbage.GarbagePage,
    "bag"	:feibao.admin_bag.BagPage,
    "garbage_box"	:feibao.admin_garbage_box.GarbageBoxPage,
    "money"	:feibao.admin_moneylog.MoneyLogPage,
    "notice"	:feibao.admin_notice.NoticePage,
    "preorder"	:feibao.admin_preorder.PreOrderPage,
    "putin-storage"	:feibao.admin_put_in_storage.PutInStoragePage,
    "salebox"	:feibao.admin_salebox.SaleBoxPage,
    "promotion"	:feibao.admin_promotion.PromotionLogPage,
    "sort-page"	:feibao.admin_sort.SortPage,
    "entity"	:feibao.admin_entity.EntityPage,
    "entity-label"	:feibao.admin_entity_label.EntityLabelPage,
    "ex_user"	:feibao.admin_userprofile.BoUser,
    "usermessage"	:feibao.admin_usermessage.UserMessagePage,
    
    "wxorder"	:eface.wechat.admin_wxorder.WXorderPage,
    "userwithdraw"	:feibao.admin_user_withdraw.UserWithdrawPage,
    "worker"	:feibao.admin_worker.WorkerPage,
    "sys_settings"	:feibao.admin_settings.SettingsPage,
    "static_community"	:feibao.static_community_user.CommunityUserStaticPage,
    "static_community_garbage"	:feibao.static_community_garbage.CommunityGarbageStaticPage,    
}
director = {
    "permit.programer"	:helpers.director.admin.PermitPage.PermitTable,
    "permit.programer.edit"	:helpers.director.admin.PermitFormPage.PermitForm,
    "GroupExport"	:helpers.case.jb_admin.admin_user.GroupExport,
    "jb_user"	:helpers.case.jb_admin.admin_user.UserPage.tableCls,
    "jb_user.edit"	:helpers.case.jb_admin.admin_user.UserFields,
    "user.picker"	:helpers.case.jb_admin.admin_user.UserPicker,
    "jb_group"	:helpers.case.jb_admin.admin_user.GroupPage.tableCls,
    "jb_group.edit"	:helpers.case.jb_admin.admin_user.GroupForm,
    "groupuserlist"	:helpers.case.jb_admin.admin_user.GroupUserList,
    "authuser.regist"	:helpers.authuser.admin_regist.RegistFormPage.fieldsCls,
    "wxuserinfo"	:eface.wechat.admin_wxuser.wxuser.tableCls,
    "wxuserinfo2user"	:eface.wechat.admin_wxuser.wxinfo2user,
    "community"	:feibao.admin_community.CommunityPage.tableCls,
    "community.edit"	:feibao.admin_community.CommunityForm,
    "region"	:feibao.admin_region.RegionPage.tableCls,
    "region.edit"	:feibao.admin_region.RegionForm,
    #"region-garbage"	:feibao.admin_region.GarbagePriceTab,
    #"region-price-link-form"	:feibao.admin_region.GarbagePriceLinkForm,
    "order/list"	:feibao.admin_order.UserOrderTable,
    "userbag/list"	:feibao.admin_order.UserBagTable,
    "order"	:feibao.admin_order.OrderPage.tableCls,
    "order.edit"	:feibao.admin_order.OrderForm,
    "order-item-tab"	:feibao.admin_order.ItemOderTab,
    "garbage"	:feibao.admin_garbage.GarbagePage.tableCls,
    "garbage.edit"	:feibao.admin_garbage.GarbageForm,
    "garbage-region-price-tab"	:feibao.admin_garbage.GarbageRegionPriceTab,
    "garbage-region-price-tab.edit"	:feibao.admin_garbage.GarbageRegionPriceForm,
    "bag/list"	:feibao.admin_bag.OutBagTable,
    "bag"	:feibao.admin_bag.BagPage.tableCls,
    "bag.edit"	:feibao.admin_bag.BagForm,
    "bat.batch"	:feibao.admin_bag.BatchBag,
    "bag.download"	:feibao.admin_bag.QrCodeDownload,
    "garbage_box"	:feibao.admin_garbage_box.GarbageBoxPage.tableCls,
    "garbage_box.edit"	:feibao.admin_garbage_box.GarbageBoxForm,
    "user/money-list"	:feibao.admin_moneylog.UserMoneyList,
    "money"	:feibao.admin_moneylog.MoneyLogPage.tableCls,
    "notice"	:feibao.admin_notice.NoticePage.tableCls,
    "notice.edit"	:feibao.admin_notice.NoticeForm,
    "preorder/list"	:feibao.admin_preorder.PreOrderTable,
    "preorder"	:feibao.admin_preorder.PreOrderPage.tableCls,
    "preorder.edit"	:feibao.admin_preorder.PreOrderForm,
    "putin-form"	:feibao.admin_put_in_storage.PutInForm,
    "baggroup"	:feibao.admin_put_in_storage.BagGroupTabel,
    "bag-group.bag"	:feibao.admin_put_in_storage.BagGroupBagTab,
    "salebox"	:feibao.admin_salebox.SaleBoxPage.tableCls,
    "salebox.edit"	:feibao.admin_salebox.SaleBoxForm,
    "worker/promotion"	:feibao.admin_promotion.WorkerPromotionTable,
    "promotion"	:feibao.admin_promotion.PromotionLogPage.tableCls,
    "entity-user-picker"	:feibao.admin_entity.EntityUserPick,
    "entity"	:feibao.admin_entity.EntityPage.tableCls,
    "entity.edit"	:feibao.admin_entity.EntityForm,
    "entity-user-tab"	:feibao.admin_entity.EntityUserTab,
    "entity-label"	:feibao.admin_entity_label.EntityLabelPage.tableCls,
    "entity-label.edit"	:feibao.admin_entity_label.EntityLabelForm,
    "bouser"	:feibao.admin_userprofile.BoUser.tableCls,
    "bouser.edit"	:helpers.case.jb_admin.admin_user.UserFields,
    "bouser-form"	:feibao.admin_userprofile.UserprofileForm,
    "usermessage"	:feibao.admin_usermessage.UserMessagePage.tableCls,
    
    "wxuserinfo.edit"	:eface.wechat.admin_wxuser.WxinfoForm,
    "wxorder"	:eface.wechat.admin_wxorder.WXorderPage.tableCls,
    "permit.options"	:hello.permit.get_permit,
    "region-garbage"	:feibao.admin_region.GarbageRegionPriceTab,
    "region-garbage.edit"	:feibao.admin_region.GarbageRegionPriceForm,
    "open-hole"	:feibao.admin_salebox.OpenHole,
    "sale-download"	:feibao.admin_salebox.SaleBoxQrDownload,
    "box-download"	:feibao.admin_garbage_box.BoxQrDownload,
    "usermessage.edit"	:feibao.admin_usermessage.UserMessageForm,
    "userwithdraw"	:feibao.admin_user_withdraw.UserWithdrawPage.tableCls,
    "userwithdraw.edit"	:feibao.admin_user_withdraw.UserWithdrawForm,
    "worker"	:feibao.admin_worker.WorkerPage.tableCls,
    "worker.edit"	:feibao.admin_worker.WorkerForm,
    "worker-select"	:feibao.admin_worker.WorkerPicker,
    "sys_settings"	:feibao.admin_settings.SettingsPage.fieldsCls,
    "static_community"	:feibao.static_community_user.CommunityUserStaticPage.tableCls,
    "static_community_garbage"	:feibao.static_community_garbage.CommunityGarbageStaticPage.tableCls,    
    "box.ReigonTab"	:feibao.admin_garbage_box.ReigonTab,
}
director_views = {
    "d.save_row"	:helpers.director.dapi.save_row,
    "d.get_row"	:helpers.director.dapi.get_row,
    "get_row"	:helpers.director.dapi.get_row,
    "d.get_row_form_db"	:helpers.director.dapi.get_row_form_db,
    "d.get_rows"	:helpers.director.dapi.get_rows,
    "d.save_rows"	:helpers.director.dapi.save_rows,
    "save_rows"	:helpers.director.dapi.save_rows,
    "d.get_head_context"	:helpers.director.dapi.get_head_context,
    "d.director_element_call"	:helpers.director.dapi.director_element_call,
    "d.delete_query_related"	:helpers.director.dapi.search_delete_related,
    "d.delete_rows"	:helpers.director.dapi.del_rows,
    "username/login"	:helpers.authuser.admin_login.login,
    "do_login"	:helpers.authuser.admin_login.run,
    "do_logout"	:helpers.authuser.admin_login.do_logout,
    "authuser.changepswd"	:helpers.authuser.admin_pswd.changepswd,
    "wx_jssdk_config_parameter"	:eface.wechat.jssdk.get_config_parameter,
    "wxmin/login"	:eface.wechat.wxMinApp.wxmin_login,
    "wxmin/userinfo"	:eface.wechat.wxMinApp.wxmin_userinfo,
    "wxmin/phone"	:eface.wechat.wxMinApp.upload_phone,
    "get_region_no_garbage"	:feibao.admin_region.get_region_no_garbage,
    "test"	:feibao.admin_order.test,
    "order/user-bind"	:feibao.admin_order.user_bag, # 扫描领取回收袋
    "order/collect"	:feibao.admin_order.collect_bag,  # 清运
    "order/sort"	:feibao.admin_order.sorter_bag,   # 分拣
    
    "order/detail"	:feibao.admin_order.order_detail,
    "garbage/price"	:feibao.admin_garbage.garbage_price,
    "garbage/price-as-kind"	:feibao.admin_garbage.garbage_price_as_kind,
    "bag/count"	:feibao.admin_bag.admin_bag_count,
    "userinfo/loc"	:feibao.admin_garbage_box.update_user_loc,
    "preorder/subscribe"	:feibao.admin_preorder.preorder,
    "preorder/worker-recieve"	:feibao.admin_preorder.recieve_preorder,
    "preorder/worker-finish"	:feibao.admin_preorder.finish_preorder,
    "preorder/worker-memo"	:feibao.admin_preorder.memo_preorder,
    "baggroup/recieve"	:feibao.admin_put_in_storage.recieve_baggroup, # 领取袋子
    "salebox/info"	:feibao.admin_salebox.salebox_hole,
    "salebox/load-bag"	:feibao.admin_salebox.admin_box_status,  # 上袋
    "salebox/status"	:feibao.admin_salebox.recieve_box_status,
    #"open_lock"	:feibao.admin_salebox.open_lock,
    "add_user_to_entity"	:feibao.admin_entity.add_user_to_entity,
    "remove_user_from_entity"	:feibao.admin_entity.remove_user_from_entity,
    "get_userprofile"	:feibao.admin_userprofile.get_user_profile,
    "userinfo/simple"	:feibao.admin_userprofile.simple_userinfo,
    "userinfo/detail"	:feibao.admin_userprofile.userinfo,
    "userinfo/unread-message"	:feibao.admin_usermessage.user_unread_msg,
    
    "box/nearby"	:feibao.admin_garbage_box.get_nearyby_box,
    "userinfo/upload-collect-qr"	:feibao.admin_userprofile.upload_collect_qr,
    "user/withdraw"	:feibao.admin_user_withdraw.submit_withdraw,    
}

field_map = {
    django.db.models.fields.DateTimeField	:helpers.director.model_func.field_procs.datetimeproc.DateTimeProc,
    helpers.director.model_func.cus_fields.form_datetime.FormDatetime	:helpers.director.model_func.cus_fields.form_datetime.FormDatetimeProc,
    helpers.director.model_func.cus_fields.cus_picture.PictureField	:helpers.director.model_func.cus_fields.cus_picture.PictureProc,
    helpers.director.model_func.cus_fields.multi_picture.MultiPictureField	:helpers.director.model_func.cus_fields.multi_picture.MultiPictureProc,
    helpers.director.model_func.cus_fields.richtext.RichtextField	:helpers.director.model_func.cus_fields.richtext.RichtextProc,
    django.db.models.fields.DateField	:helpers.director.model_func.field_procs.dateproc.DateProc,
    django.db.models.fields.DecimalField	:helpers.director.model_func.field_procs.decimalproc.DecimalProc,
    django.db.models.fields.related.ForeignKey	:helpers.director.model_func.field_procs.foreignproc.ForeignProc,
    django.db.models.fields.related.OneToOneField	:helpers.director.model_func.field_procs.oneproc.OneProc,
    django.db.models.fields.related.ManyToManyField	:helpers.director.model_func.field_procs.manyproc.ManyProc,
    django.db.models.fields.CharField	:helpers.director.model_func.field_procs.charproc.CharProc,
    django.db.models.fields.IntegerField	:helpers.director.model_func.field_procs.intproc.IntProc,
    django.db.models.fields.SmallIntegerField	:helpers.director.model_func.field_procs.intproc.IntProc,
    django.db.models.fields.BigIntegerField	:helpers.director.model_func.field_procs.intproc.BigProc,
    django.db.models.fields.BooleanField	:helpers.director.model_func.field_procs.boolproc.BoolProc,
    django.db.models.fields.TextField	:helpers.director.model_func.field_procs.textproc.TextProc,
    django.db.models.fields.NullBooleanField	:helpers.director.model_func.field_procs.nullboolproc.NullBoolProc,
    "wechat.wxinfo.nickname"	:eface.wechat.admin_wxuser.NicknameProc,
    django.contrib.gis.db.models.fields.PointField	:eface.mylbs.field_proc.point_proc.PointProc,
}